package com.aerilys.taskboard.client.views.implementation;

import com.aerilys.taskboard.client.activities.GeneralActivity;
import com.aerilys.taskboard.client.places.GeneralViewPlace;
import com.aerilys.taskboard.client.views.DetailsView;
import com.aerilys.taskboard.client.views.GeneralView.Presenter;
import com.aerilys.taskboard.shared.Note;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Widget;

public class DetailsViewImpl extends Composite implements DetailsView
{

  private static DetailsViewImplUiBinder uiBinder = GWT.create(DetailsViewImplUiBinder.class);

  interface DetailsViewImplUiBinder extends UiBinder<Widget, DetailsViewImpl>
  {
  }

  private Presenter presenter;

  @UiField
  DivElement nameTask;
  
  @UiField
  DivElement descriptionTask;

  public DetailsViewImpl()
  {
    initWidget(uiBinder.createAndBindUi(this));
  }

  @Override
  public void updateUIWithNote(Note note)
  {
    nameTask.setInnerHTML("<h1>"+note.getNom()+"</h1>");
    descriptionTask.setInnerHTML(note.getDescription());
  }

  @Override
  public void setPresenter(Presenter presenter)
  {
    this.presenter = presenter;
  }

}
